package com.runnirr.doodles.Menu;

import com.runnirr.doodles.R;
import com.runnirr.doodles.Database.DataManagementHelper;

import android.content.Context;
import android.view.MenuItem;


public class MenuActions {
	
	private static MenuActions self = null;
	
	private MenuActions(){ 	}
	
	public synchronized static MenuActions getInstance(){
		if (self == null){
			self = new MenuActions();
		}
		return self;
	}
	
	public boolean handleClick(MenuItem item, Context c) {
		// Handle item selection
	    switch (item.getItemId()) {
	    	case R.id.menuSettings:
	    		onViewSettings();
	    		return true;
	    	case R.id.menuResetStorage:
	    		onResetStorage(c);
	            return true;
	        default:
	            return false;
	    }
	}
	
	private void onResetStorage(Context c){
		System.out.println("Reset storage");
		new DataManagementHelper(c).deleteAllData();
	}
	
	private void onViewSettings(){
		System.out.println("View settings");
	}
	



}
